
package com.wuhao.code.check.style.arrangement

import com.intellij.psi.codeStyle.arrangement.std.StdArrangementTokens.Order.KEEP
import com.wuhao.code.check.style.KotlinEntryType.CLASS
import com.wuhao.code.check.style.KotlinEntryType.COMPANION_OBJECT
import com.wuhao.code.check.style.KotlinEntryType.DATA_CLASS
import com.wuhao.code.check.style.KotlinEntryType.ENUM_ENTRY
import com.wuhao.code.check.style.KotlinEntryType.FUNCTION
import com.wuhao.code.check.style.KotlinEntryType.INIT_BLOCK
import com.wuhao.code.check.style.KotlinEntryType.INTERFACE
import com.wuhao.code.check.style.KotlinEntryType.OBJECT
import com.wuhao.code.check.style.KotlinEntryType.PROPERTY
import com.wuhao.code.check.style.KotlinEntryType.SECONDARY_CONSTRUCTOR
import com.wuhao.code.check.style.KotlinModifier.INNER
import com.wuhao.code.check.style.KotlinModifier.INTERNAL
import com.wuhao.code.check.style.KotlinModifier.LATEINIT
import com.wuhao.code.check.style.KotlinModifier.OPEN
import com.wuhao.code.check.style.KotlinModifier.PRIVATE
import com.wuhao.code.check.style.KotlinModifier.PROTECTED

/**
 * kotlin代码排序规则列表
 * @author 吴昊
 * @since 1.3.1
 */
object KotlinRearrangeRules : BaseRules() {

  override fun get(): List<RuleDescription> {
    return listOf(
        RuleDescription(listOf(PROPERTY, OPEN), KEEP),
        RuleDescription(listOf(PROPERTY, OPEN, INTERNAL), KEEP),
        RuleDescription(listOf(PROPERTY, OPEN, PROTECTED), KEEP),
        RuleDescription(listOf(PROPERTY, OPEN, PRIVATE), KEEP),
        RuleDescription(listOf(PROPERTY, OPEN, LATEINIT), KEEP),
        RuleDescription(listOf(PROPERTY, OPEN, INTERNAL, LATEINIT), KEEP),
        RuleDescription(listOf(PROPERTY, OPEN, PROTECTED, LATEINIT), KEEP),
        RuleDescription(listOf(PROPERTY, OPEN, PRIVATE, LATEINIT), KEEP),
        RuleDescription(PROPERTY, KEEP),
        RuleDescription(listOf(PROPERTY, INTERNAL), KEEP),
        RuleDescription(listOf(PROPERTY, PROTECTED), KEEP),
        RuleDescription(listOf(PROPERTY, PRIVATE), KEEP),
        RuleDescription(listOf(PROPERTY, LATEINIT), KEEP),
        RuleDescription(listOf(PROPERTY, INTERNAL, LATEINIT), KEEP),
        RuleDescription(listOf(PROPERTY, PROTECTED, LATEINIT), KEEP),
        RuleDescription(listOf(PROPERTY, PRIVATE, LATEINIT), KEEP),

        RuleDescription(COMPANION_OBJECT, KEEP),
        RuleDescription(listOf(COMPANION_OBJECT, PRIVATE), KEEP),

        RuleDescription(INIT_BLOCK, KEEP),

        RuleDescription(SECONDARY_CONSTRUCTOR, KEEP),
        RuleDescription(ENUM_ENTRY, KEEP),
        RuleDescription(listOf(FUNCTION, OPEN), KEEP),
        RuleDescription(listOf(FUNCTION, OPEN, INTERNAL), KEEP),
        RuleDescription(listOf(FUNCTION, OPEN, PROTECTED), KEEP),
        RuleDescription(listOf(FUNCTION, OPEN, PRIVATE), KEEP),
        RuleDescription(listOf(FUNCTION, OPEN), KEEP),
        RuleDescription(listOf(FUNCTION, OPEN, INTERNAL), KEEP),
        RuleDescription(listOf(FUNCTION, OPEN, PROTECTED), KEEP),
        RuleDescription(listOf(FUNCTION, OPEN, PRIVATE), KEEP),
        RuleDescription(FUNCTION, KEEP),
        RuleDescription(listOf(FUNCTION, INTERNAL), KEEP),
        RuleDescription(listOf(FUNCTION, PROTECTED), KEEP),
        RuleDescription(listOf(FUNCTION, PRIVATE), KEEP),

        RuleDescription(INNER, KEEP),
        RuleDescription(INTERFACE, KEEP),
        RuleDescription(OBJECT, KEEP),
        RuleDescription(DATA_CLASS, KEEP),
        RuleDescription(CLASS, KEEP)
    )
  }

}

